#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include<string.h>

int main() {
    char arr[100];
    scanf("%s", arr);
    int count_a = 0;
    int count_b = 0;
    int i = 0;
    int sz = strlen(arr);
    for (i = 0; i < sz; i++)
    {
        if (arr[i] == 'A')
        {
            count_a++;
        }
        if (arr[i] == 'B')
        {
            count_b++;
        }
    }
    if (count_a > count_b)
    {
        printf("A");
    }
    else if (count_a < count_b)
    {
        printf("B");
    }
    else
    {
        printf("E");
    }
    return 0;
}